package com.neusoft.hifly.gateway.utils;

public enum RedisKeys {
	API_POWER("tenant:api:power"),

	GATEWAY_ROUTE("sys:gateway:route");

	private String key;

	RedisKeys(final String key) {
		this.key = key;
	}

	/**
	 * 根据状态字符串获取token状态枚举对象
	 *
	 * @param key
	 *            枚举信息
	 * @return TokenState信息
	 */
	public static RedisKeys getTokenState(final String key) {
		final RedisKeys[] states = RedisKeys.values();
		RedisKeys ts = null;
		for (final RedisKeys state : states) {
			if (state.toString().equals(key)) {
				ts = state;
				break;
			}
		}
		return ts;
	}

	@Override
	public String toString() {
		return this.key;
	}

	public String getKey() {
		return key;
	}

}
